import request from '@/utils/request'
import qs from 'qs'
import { Base64 } from 'js-base64';

// 平台列表
export function list(params) {
  return request({
    url: '/platform/page',
    method: 'get',
    params
  })
}

export function simpleList(params) {
  return request({
    url: '/platform/simpleList',
    method: 'get',
    params
  })
}

export function save(data) {
  return request({
    url: '/platform/save',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/platform/update',
    method: 'post',
    data
  })
}

// 详情
export function detail(id) {
  return request({
    url: '/platform/detail',
    method: 'get',
    params:{
      id
    }
  })
}

// 详情 头部数据汇总
export function summary(id) {
  return request({
    url: '/platform/summaryInfo',
    method: 'get',
    params:{
      id
    }
  })
}
export function areaSummary(id) {
  return request({
    url: '/platform/areaSummary',
    method: 'get',
    params:{
      id
    }
  })
}

// 删除平台
export function remove(data) {
  return request({
    url: '/platform/remove',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    },
    data: qs.stringify(data),
  })
}

// 平台运维列表
export function operateList(params) {
  return request({
    url: '/platform/operate/list',
    method: 'get',
    params
  })
}
//  市场份额
export function marketShare(params) {
  return request({
    url: '/platform/operate/marketShare',
    method: 'get',
    params
  })
}